//
// Created by v on 19-6-25.
//

#ifndef JKLIBS_CMDATABASEPROXY_H
#define JKLIBS_CMDATABASEPROXY_H

#include "CMDatabaseSqlite.h"

class CMDatabaseProxy
{
  public:
    CMDatabaseProxy(const char *sqltype, const char *dbfile);
    ~CMDatabaseProxy();

    // only execute sql, no result return, but has errMsg
    int query(const char *sql, CMDatabaseResult &result);
    // to Query, will give result return
    int queryResult(const char *sql, CMDatabaseResult &result);

    void debugPrintResult(const CMDatabaseResult &result);

  private:
    CMDatabaseBase *m_dbHandler;
    std::string     m_dbfile;
    bool            m_opened;
};

#endif // JKLIBS_CMDATABASEPROXY_H
